home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14861 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: news.dal.ca!news
  2. From: Klaus.Eichele@Dal.Ca (Klaus Eichele)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Turbo 3.0 compiler bug -- I MEAN IT!!!!
  5. Date: Tue, 02 Apr 1996 17:05:09 GMT
  6. Organization: Dalhousie University
  7. Message-ID: <4jr8m7$kpm@News.Dal.Ca>
  8. References: <4jpp78$85b@news.vanderbilt.edu>
  9. NNTP-Posting-Host: rewasylishen.chem.dal.ca
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. haseltbt@ctrvax.vanderbilt.edu (Bennett Haselton) wrote:
  13. >    Hello world,
  14.  
  15. >        i've found what appears to be a bug in the Turbo 3.0 C++ 
  16. >compiler.  Apparently if you write a while loop that is immediately preceded by 
  17. >code identical to that contained in the while loop--and the "while" statement 
  18. >is true at the time the code immediately preceding it is analyzed--then the 
  19. >compiler ignores this extra code preceding the while loop as unnecessary.  
  20. >Seems reasonable--equivalent output, right?
  21. >    The problem is in the debugging process.  i had written code with the 
  22. >above-mentioned redundancy to make it easier to read, and in the debugging 
  23. >cycle i tried setting breakpoints within the block of "redundant" code.  Turbo 
  24. >C++ will not allow breakpoints to be set at empty or commented space; 
  25. >unfortunately the redundant code was compiled as "empty space" and breakpoints 
  26. >were forbidden there.  Worse, when the compiler skipped to a breakpoint inside 
  27. >the while loop, it became obvious from the values of watch variables that the 
  28. >redundant code had been skipped entirely.
  29.    <SNIP>
  30.  
  31. Hi, I don't think your discovery qualifies as a bug. For your
  32. particular problem, however, you might want to try to switch of
  33. optimization. Without optimization, you should get the result you
  34. expect.
  35.  
  36. Good Luck,
  37. Klaus
  38.  
  39. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  40. Klaus Eichele         keichele@is.dal.ca  
  41. http://is.dal.ca/~keichele/keichele.html
  42.  
  43.